<!DOCTYPE html>
<html lang="zh-Hans-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="~{layout/admin_layout}"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">


<th:block layout:fragment="content">
    welcome <span sec:authentication="name">Admin</span>!
    <div sec:authorize="isAuthenticated()">
        <p>登录的用户为：<span sec:authentication="name"></span></p>
        <p>用户角色为：<span sec:authentication="principal.authorities"></span></p>
    </div>
    <br/><br/>
    <a th:href="@{/}">Back to links</a><br/>
    <a th:href="@{/admin/logout}">logout.</a><br/>
</th:block>